import { HTTP } from "./HTTP";

// 消息列表
export function getMessageList(data) {
  return HTTP({
    url: "/message/page",
    method: "get",
    data,
  });
}

// 消息详情
export function getMessageDetail(id) {
  return HTTP({
    url: `/message/${id}`,
    method: "get",
  });
}

// 指标列表
export function getTargetDeclarationRecordList(data) {
  return HTTP({
    url: `/targetDeclarationRecord/page`,
    method: "get",
    data,
  });
}

// 指标填报详情
export function getTargetDeclarationRecordDetail(id) {
  return HTTP({
    url: `/targetDeclarationRecord/${id}`,
    method: "get",
  });
}

// 指标填报
export function writeTargetDeclaration(data) {
  return HTTP({
    url: `/targetDeclarationRecord`,
    method: "POST",
    data,
  });
}

// 编辑填报
export function editTargetDeclaration(data) {
  return HTTP({
    url: `/targetDeclarationRecord`,
    method: "put",
    data,
  });
}

// 未读消息
export function getNoReadMessageList(data) {
  return HTTP({
    url: `/message/list`,
    method: "get",
    data,
  });
}

// 指标详情
export function getTargetDeclarationRecord(id) {
  return HTTP({
    url: `/targetManagement/${id}`,
    method: "get",
  });
}

// 消息已读
export function readMessage(id) {
  return HTTP({
    url: `/message/read`,
    method: "get",
    data: { id },
  });
}

// 查询历史填报文件
export function getFiles(targetDeclarationRecordId) {
  return HTTP({
    url: `/targetDeclarationRecordFile/getFiles/${targetDeclarationRecordId}`,
    method: "get",
  });
}
// 查询合并文件
export function getConcatFile(targetDeclarationRecordId) {
  return HTTP({
    url: `/targetDeclarationRecordFile/getFile/${targetDeclarationRecordId}`,
    method: "get",
  });
}